﻿using System.Collections.Generic;

namespace Ro.Common.RoInterface.UserType
{
    /// <summary>
    /// RoClient
    /// </summary>
    public class RoClient
    {
        /// <summary>
        /// 在Tcs中 Client相关的控件使用类型
        /// </summary>
        public class ControlUseType
        {
            /// <summary>
            /// 使用的tci文件 ID
            /// </summary>
            public string TciId { get; set; }

            /// <summary>
            /// 使用的控件 ID
            /// </summary>
            public string ControlId { get; set; }


            /// <summary>
            /// Client控件的信息，包含寻址
            /// </summary>
            public ControlInfo ControlInfo { get; set; }
        }


        /// <summary>
        /// 单个Tci控件的元素信息
        /// 针对Client端
        /// </summary>
        public class ControlInfo
        {
            /// <summary>
            /// 控件类型
            /// </summary>
            public string ControlType { get; set; }


            /// <summary>
            /// 控件Id
            /// </summary>
            public string ControlId { get; set; }

            /// <summary>
            /// 控件Index值
            /// </summary>
            public int Index { get; set; }

            /// <summary>
            /// 控件父级
            /// </summary>
            public string ReferenceContainer { get; set; }


            /// <summary>
            /// 控件元素信息
            /// </summary>
            public SearchProperties SearchProperties { get; set; }
        }


        /// <summary>
        ///  控件元素信息
        /// </summary>
        public class SearchProperties
        {
            /// <summary>
            /// 元素的 automaitonid
            /// </summary>
            public string ElementAutomationId { get; set; }

            /// <summary>
            /// 元素的 name
            /// </summary>
            public string ElementName { get; set; }

            /// <summary>
            /// 元素的 classname
            /// </summary>
            public string ElementClassName { get; set; }
        }
    }


    /// <summary>
    /// RoWeb
    /// TODO 3-15重新更新 TciID作为主键保存，对应tci内的控件信息写入KeyValuePair中，通过ControlID进行筛选
    /// </summary>
    public class RoWeb
    {
        /// <summary>
        /// 在Tcs中 Client相关的控件使用类型
        /// 包含tciId
        /// 包含ControlInfos
        /// </summary>
        public class ControlUseType
        {
            /// <summary>
            /// 使用的tci文件 ID,作为主键保存
            /// </summary>
            public string TciId { get; set; }

            /// <summary>
            /// todo 3-31更新 List中仅包含一个tci文件中的所有控件信息
            /// </summary>
            public List<OneTciInfo> OneTciInfos { get; set; }
        }

        /// <summary>
        /// 单个Tci控件的元素信息
        /// 包含控件名称，Index值
        /// 针对Web端
        /// </summary>
        public class OneTciInfo
        {
            /// <summary>
            /// 控件名称
            /// </summary>
            public string ControlName { get; set; }
            /// <summary>
            /// 控件Index值
            /// </summary>
            public int Index { get; set; }

            /// <summary>
            /// 元素的 locator值
            /// </summary>
            public string Locator { get; set; }

            /// <summary>
            /// 元素的 value
            /// </summary>
            public string Value { get; set; }
        }
    }
}
